using System;
using System.Runtime.Serialization;
using Director.StockSharp.Transaq.Native.Responses;

namespace Director.DomainModels
{
	[DataContract]
	public class Trade 
	{
		public Trade(TransaqMyTrade trade)
		{
			SecCode = trade.SecCode;
			IsBuy = trade.BuySell == BuySells.B;
			Price = trade.Price;
			Quantity = trade.Quantity;
			Time = trade.Time;
			OrderNo = trade.OrderNo;
			Comission = trade.Comission.GetValueOrDefault();
			Currentpos = trade.CurrentPos;
			TradeNo = trade.TradeNo;
		}

		[DataMember]
		public long TradeNo { get; set; }

		[DataMember]
		public long OrderNo { get; set; }

		[DataMember]
		public string SecCode { get; set; }

		[DataMember]
		public bool IsBuy { get; set; }

		[DataMember]
		public DateTime Time { get; set; }

		[DataMember]
		public int Quantity { get; set; }

		[DataMember]
		public long Currentpos { get; set; }

		[DataMember]
		public decimal Price { get; set; }

		[DataMember]
		public decimal Comission { get; set; }
	}
}